package cn.javass.dp.observer.example3;



public class Client {
    public static void main(String[] args) {
        //被观察者
        NewPaper subject = new NewPaper();

        //观察者
        Reader reader1 = new Reader();
        reader1.setName("张三");

        Reader reader2 = new Reader();
        reader2.setName("李四");

        subject.addObserver(reader1);
        subject.addObserver(reader2);

        subject.setContent("本期内容是观察则模式");
    }

}
